<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition 
    template="/template/templatePadrao.xhtml"
    xmlns="http://www.w3.org/1999/xhtml"
    xmlns:h="http://xmlns.jcp.org/jsf/html"
    xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
    xmlns:p="http://primefaces.org/ui"
    xmlns:f="http://xmlns.jcp.org/jsf/core">
    <ui:define name="conteudoCentro">
        <h:form id="formLocal">
            <p:messages id="mLocal" showDetail="true"/>
            <p:panel id="imPanelLocal" header="Local" style="text-align: center">
                <center>
                    <h:inputHidden 
                        id="imIHLocal" 
                        value="#{localBean.local.id}"/>
                    <h:panelGrid id="imGridLocal" columns="2">
                        <h:outputText title="Nome do local." 
                                      value="Nome:"/>
                        <p:inputText
                            id="itNomeLocal" 
                            value="#{localBean.local.nome}"
                            maxlength="45"
                            requiredMessage="Campo obrigatório" 
                            required="true"
                            />
                        <h:outputText value="Complemento:"
                                      title="Informações extras que possam ajudar a identificação do lugar (Não obrigatório)."
                                      />
                        <p:inputTextarea
                            id="itaComplemento" 
                            maxlength="450"
                            value="#{localBean.local.complemento}"                      
                            />
                        <h:outputText value="Latitude:"
                                      title="Numeração equivalente a latitude."
                                      />
                        <p:inputText
                            id="itLatitude" 
                            value="#{localBean.local.latitude}"
                            />
                        <h:outputText value="Longitude:"
                                      title="Numeração equivalente a longitude"/>
                        <p:inputText
                            id="itLongitude" 
                            value="#{localBean.local.longitude}"
                            />
                        <p:commandButton
                            id="imSalvar"
                            ajax="false"
                            icon="ui-icon-check"
                            value="Salvar"
                            update="formLocal"
                            action="#{localBean.salvar()}"/>
                        <p:button
                            id="imCancelar"
                            icon="ui-icon-closethick"
                            value="Cancelar"
                            href="/sistema/inicio.jsf"
                            />
                    </h:panelGrid>
                </center>
            </p:panel>
        </h:form>
    </ui:define>
</ui:composition>

